package com.xncoding.test;

import org.junit.Test;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public class test {

    public static void cache(boolean iscache,boolean isuod){
       if (isuod){
           System.out.println("必须强制刷新");
       }else {
           if (iscache){
               System.out.println("续期");
           }else {
               System.out.println("没有了强制刷新");
           }
       }
    }


    public static void cacheold(boolean iscache,boolean isuod){

            if (!iscache && isuod){
                System.out.println("续期");
            }else {
                System.out.println("没有了强制刷新");
            }

    }

    @Test
    public void test00(){
        boolean b = false;
        Object obj = null;
        b = ObjectUtils.isEmpty(obj); // true
        System.out.println(b);

        System.out.println(ObjectUtils.isEmpty(new HashMap<>()));

        Map<String,Object> map = Collections.emptyMap();
        System.out.println(CollectionUtils.isEmpty(map));
    }

    public static void main(String[] args) {
        /*cache(true,true);
        cache(true,false);
        cache(false,true);
        cache(false,false);*/

        cacheold(true,true);
        cacheold(true,false);
        cacheold(false,true);
        cacheold(false,false);
    }

}
